﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RayDen.Library.Data.Imaging
{
    #region Tone Mapping

    public enum ToneMapType
    {
        TONEMAP_LINEAR,
        TONEMAP_REINHARD02,
        WARD

    }

    public abstract class ToneMapParams
    {
        public abstract ToneMapType GetToneMapType();
        public abstract ToneMapParams Copy();
    };

    public class LinearToneMapParams : ToneMapParams
    {
        public
            LinearToneMapParams(float s = 1f)
        {
            scale = s;
        }

        public override ToneMapType GetToneMapType()
        {
            return ToneMapType.TONEMAP_LINEAR;
        }

        public override ToneMapParams Copy()
        {
            return new LinearToneMapParams(scale);
        }

        public float scale;
    };

    public class Reinhard02ToneMapParams : ToneMapParams
    {
        public
            Reinhard02ToneMapParams(float preS = 1f, float postS = 1.2f,
                    float b = 0.95f)
        {
            preScale = preS;
            postScale = postS;
            burn = b;
        }

        public override ToneMapType GetToneMapType()
        {
            return ToneMapType.TONEMAP_REINHARD02;
        }

        public override ToneMapParams Copy()
        {
            return new Reinhard02ToneMapParams(preScale, postScale, burn);
        }

        public float preScale, postScale, burn;
    };
    #endregion
}
